package com.fourth.service.impl;

import com.fourth.entity.Cart;
import com.fourth.dao.CartMapper;
import com.fourth.service.CartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author
 */
@Service
public class CartServiceImpl implements CartService {

    @Resource
    private CartMapper cartMapper;

    @Override
    public List<Cart> selectCartByUid(Integer uId) {
        return cartMapper.selectCartByUid(uId);
    }

    @Override
    public void updateGoodsNum(Integer uId,String goodId) {
        cartMapper.updateGoodsNum(uId,goodId);
    }

    @Override
    public void downdateGoodsNum(Integer uId,String goodId) {
        cartMapper.downdateGoodsNum(uId,goodId);
    }

    @Override
    public int insertCartItem(Cart cart) {
        return cartMapper.insertCartItem(cart);
    }

    @Override
    public Integer selectCartNum(Integer uId) {
        return cartMapper.selectCartNum(uId);
    }

    @Override
    public int deletCartItem(Integer uId, String goodId) {
        return cartMapper.deletCartItem(uId,goodId);
    }


}
